package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import javax.print.attribute.Size2DSyntax;

import jtk.project4.fleet.domain.RbItem;
import jtk.project4.fleet.domain.RbItemBak;
import jtk.project4.fleet.domain.Vendor;

public class Rbitem_bakDao extends IbatisDao
{
	public List selectRbitem_baks() throws SQLException 
	{
		List selectRbitem_baks = null;
			selectRbitem_baks =getSqlMap().queryForList("SELECT_ALL_RBITEM_BAK", null);
		return selectRbitem_baks;
	}
	
	public RbItemBak insertRbItemBak(RbItemBak rbitemBak) throws SQLException
	{
		return (RbItemBak) getSqlMap().insert("INSERT_RBITEM_BAK", rbitemBak);
	}
	
	public int deleteRbItemBak(RbItemBak rbitemBak) throws SQLException
	{
		return (int) getSqlMap().delete("DELETE_RBITEM_BAK", rbitemBak);
	}
	
	public int updateRbItemBak(RbItemBak rbitemBak) throws SQLException
	{
		return (int) getSqlMap().update("UPDATE_RBITEM_BAK", rbitemBak);
	}
	
	public static void main (String args[]) throws SQLException
	{
		RbItemBak rbitembak;
		List<RbItemBak> Rbitembaks;
		rbitembak = new RbItemBak();
		//rbitembak.setName("Ilejji");
		//new Rbitem_bakDao().insertRbItemBak(rbitembak);
		//rbitembak.setName("ilejji");
		//new Rbitem_bakDao().deleteRbItemBak(rbitembak);
		rbitembak.setName("ilejji yanti purba");
		rbitembak.setItemId(26);
		new Rbitem_bakDao().updateRbItemBak(rbitembak);
		Rbitembaks=new Rbitem_bakDao().selectRbitem_baks();
		System.out.println(Rbitembaks.size());
		
	}
}
